# Contributor: James Bowes <jbowes@repl.ca>
# Maintainer:
pkgname=rocksdb
pkgver=5.15.10
pkgrel=4
pkgdesc="A persistent key-value store for fast storage environments"
url="https://rocksdb.org"
# fails to build on other archs
arch="x86 x86_64 ppc64le"
license="GPL-2.0"
depends=""
depends_dev="bzip2-dev snappy-dev zlib-dev lz4-dev zstd-dev"
makedepends="$depends_dev linux-headers bash perl"
install=""
subpackages="$pkgname-dev $pkgname-doc"
options="!check" # no upstream/available test-suite
source="$pkgname-$pkgver.tar.gz::https://github.com/facebook/$pkgname/archive/v$pkgver.tar.gz
	ppc64le-determine-platform.patch
	10-support-busybox-install.patch"

_builddir="$srcdir/$pkgname-$pkgver"
build() {
	cd "$_builddir"
	make shared_lib
}

package() {
	cd "$_builddir"
	INSTALL_PATH="$pkgdir"/usr make install-shared
	install -Dm644 COPYING "$pkgdir"/usr/share/licenses/$pkgname/COPYING
	mkdir -p "$pkgdir"/usr/share/doc
	cp -a docs "$pkgdir"/usr/share/doc/$pkgname
	install -Dm644 README.md "$pkgdir"/usr/share/doc/$pkgname/README.md
	install -Dm644 HISTORY.md "$pkgdir"/usr/share/doc/$pkgname/HISTORY.md
}

sha512sums="3faef43cc343c20e044f92af7cd9eae9783612d888bfe17b7d0ae6812090088f43a128e5686600ec56f5a88c100eaa893b2551f8c32df793a4ccd94330c07037  rocksdb-5.15.10.tar.gz
a7445cf958e414b6eac8a4f05e82fa980c00276da7305a158f3fa77f71bdff606713cd88fae8db0b9fb97125fef646e9e6245fef3a3f2e97d0ef20be259fb37d  ppc64le-determine-platform.patch
2b33041baa061e6cedfcbc606fd9752d907ebba84cb76ff13641ac4683e614e527530453bcbe0e0c6b67b36415dee477aec268024a05b8815c534f4d6bfb6cc0  10-support-busybox-install.patch"
